﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using System.Collections.Generic;
using System.Linq;
using ScrumTable.Common;
using ScrumTable.Common.Collections;
using ScrumTable.Common.Logging;
using ScrumTable.Common.Net;
using ScrumTable.DL.Data.Generic.Properties;

#endregion


namespace ScrumTable.DL.Data.Generic.Cache
{
    /// <summary>
    /// This class wraps a team foundation project instance.
    /// </summary>
    public class CacheTeam : CacheElementBase
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the name which is used to reference this element from other
        /// CacheElements.
        /// </summary>
        public override string ReferenceName
        {
            get { return BackEndId; }
        }

        /// <summary>
        /// Gets the underlying display name.
        /// </summary>
        public string DisplayName
        {
            get; private set;
        }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new CacheProject instance. This constructor is used in
        /// the current library only.
        /// </summary>
        internal CacheTeam(
            string uniqueId,
            double orderIndex,
            string displayName,
            string backEndId)
            : base(uniqueId, CacheIdentity.DefaultId, displayName, CacheIdentity.DefaultRevision, orderIndex)
        {
            DisplayName = (displayName ?? string.Empty);
            BackEndId = backEndId;
        }

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new clone instance of the current object.
        /// </summary>
        /// <returns>Returns the created clone instance.</returns>
        protected override CacheElementBase CreateCloneInstance()
        {
            return new CacheTeam(
                UniqueId,
                OrderIndex,
                DisplayName,
                BackEndId);
        }

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}